{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 题目一"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "logical and\n",
      "epoch 0 sample 0 [1 2 0 0 0 0 0]\n",
      "epoch 0 sample 1 [1 2 0 1 -1 0 -1]\n",
      "epoch 0 sample 2 [0 2 -1 1 0 -1 -1]\n",
      "epoch 0 sample 3 [0 1 -2 0 1 1 1]\n",
      "epoch 1 sample 0 [1 2 -1 0 0 0 0]\n",
      "epoch 1 sample 1 [1 2 -1 0 0 0 0]\n",
      "epoch 1 sample 2 [1 2 -1 1 0 -1 -1]\n",
      "epoch 1 sample 3 [1 1 -2 0 1 1 1]\n",
      "epoch 2 sample 0 [2 2 -1 0 0 0 0]\n",
      "epoch 2 sample 1 [2 2 -1 1 -1 0 -1]\n",
      "epoch 2 sample 2 [1 2 -2 0 0 0 0]\n",
      "epoch 2 sample 3 [1 2 -2 1 0 0 0]\n",
      "epoch 3 sample 0 [1 2 -2 0 0 0 0]\n",
      "epoch 3 sample 1 [1 2 -2 0 0 0 0]\n",
      "epoch 3 sample 2 [1 2 -2 0 0 0 0]\n",
      "epoch 3 sample 3 [1 2 -2 1 0 0 0]\n",
      "epoch 4 sample 0 [1 2 -2 0 0 0 0]\n",
      "epoch 4 sample 1 [1 2 -2 0 0 0 0]\n",
      "epoch 4 sample 2 [1 2 -2 0 0 0 0]\n",
      "epoch 4 sample 3 [1 2 -2 1 0 0 0]\n",
      "epoch 5 sample 0 [1 2 -2 0 0 0 0]\n",
      "epoch 5 sample 1 [1 2 -2 0 0 0 0]\n",
      "epoch 5 sample 2 [1 2 -2 0 0 0 0]\n",
      "epoch 5 sample 3 [1 2 -2 1 0 0 0]\n",
      "epoch 6 sample 0 [1 2 -2 0 0 0 0]\n",
      "epoch 6 sample 1 [1 2 -2 0 0 0 0]\n",
      "epoch 6 sample 2 [1 2 -2 0 0 0 0]\n",
      "epoch 6 sample 3 [1 2 -2 1 0 0 0]\n",
      "epoch 7 sample 0 [1 2 -2 0 0 0 0]\n",
      "epoch 7 sample 1 [1 2 -2 0 0 0 0]\n",
      "epoch 7 sample 2 [1 2 -2 0 0 0 0]\n",
      "epoch 7 sample 3 [1 2 -2 1 0 0 0]\n",
      "epoch 8 sample 0 [1 2 -2 0 0 0 0]\n",
      "epoch 8 sample 1 [1 2 -2 0 0 0 0]\n",
      "epoch 8 sample 2 [1 2 -2 0 0 0 0]\n",
      "epoch 8 sample 3 [1 2 -2 1 0 0 0]\n",
      "epoch 9 sample 0 [1 2 -2 0 0 0 0]\n",
      "epoch 9 sample 1 [1 2 -2 0 0 0 0]\n",
      "epoch 9 sample 2 [1 2 -2 0 0 0 0]\n",
      "epoch 9 sample 3 [1 2 -2 1 0 0 0]\n",
      "logical or\n",
      "epoch 0 sample 0 [1 2 0 0 0 0 0]\n",
      "epoch 0 sample 1 [1 2 0 1 0 0 0]\n",
      "epoch 0 sample 2 [1 2 0 1 0 0 0]\n",
      "epoch 0 sample 3 [1 2 0 1 0 0 0]\n",
      "epoch 1 sample 0 [1 2 0 0 0 0 0]\n",
      "epoch 1 sample 1 [1 2 0 1 0 0 0]\n",
      "epoch 1 sample 2 [1 2 0 1 0 0 0]\n",
      "epoch 1 sample 3 [1 2 0 1 0 0 0]\n",
      "epoch 2 sample 0 [1 2 0 0 0 0 0]\n",
      "epoch 2 sample 1 [1 2 0 1 0 0 0]\n",
      "epoch 2 sample 2 [1 2 0 1 0 0 0]\n",
      "epoch 2 sample 3 [1 2 0 1 0 0 0]\n",
      "epoch 3 sample 0 [1 2 0 0 0 0 0]\n",
      "epoch 3 sample 1 [1 2 0 1 0 0 0]\n",
      "epoch 3 sample 2 [1 2 0 1 0 0 0]\n",
      "epoch 3 sample 3 [1 2 0 1 0 0 0]\n",
      "epoch 4 sample 0 [1 2 0 0 0 0 0]\n",
      "epoch 4 sample 1 [1 2 0 1 0 0 0]\n",
      "epoch 4 sample 2 [1 2 0 1 0 0 0]\n",
      "epoch 4 sample 3 [1 2 0 1 0 0 0]\n",
      "epoch 5 sample 0 [1 2 0 0 0 0 0]\n",
      "epoch 5 sample 1 [1 2 0 1 0 0 0]\n",
      "epoch 5 sample 2 [1 2 0 1 0 0 0]\n",
      "epoch 5 sample 3 [1 2 0 1 0 0 0]\n",
      "epoch 6 sample 0 [1 2 0 0 0 0 0]\n",
      "epoch 6 sample 1 [1 2 0 1 0 0 0]\n",
      "epoch 6 sample 2 [1 2 0 1 0 0 0]\n",
      "epoch 6 sample 3 [1 2 0 1 0 0 0]\n",
      "epoch 7 sample 0 [1 2 0 0 0 0 0]\n",
      "epoch 7 sample 1 [1 2 0 1 0 0 0]\n",
      "epoch 7 sample 2 [1 2 0 1 0 0 0]\n",
      "epoch 7 sample 3 [1 2 0 1 0 0 0]\n",
      "epoch 8 sample 0 [1 2 0 0 0 0 0]\n",
      "epoch 8 sample 1 [1 2 0 1 0 0 0]\n",
      "epoch 8 sample 2 [1 2 0 1 0 0 0]\n",
      "epoch 8 sample 3 [1 2 0 1 0 0 0]\n",
      "epoch 9 sample 0 [1 2 0 0 0 0 0]\n",
      "epoch 9 sample 1 [1 2 0 1 0 0 0]\n",
      "epoch 9 sample 2 [1 2 0 1 0 0 0]\n",
      "epoch 9 sample 3 [1 2 0 1 0 0 0]\n",
      "logical xor\n",
      "epoch 0 sample 0 [1 2 0 0 0 0 0]\n",
      "epoch 0 sample 1 [1 2 0 1 0 0 0]\n",
      "epoch 0 sample 2 [1 2 0 1 0 0 0]\n",
      "epoch 0 sample 3 [1 2 0 1 -1 -1 -1]\n",
      "epoch 1 sample 0 [0 1 -1 0 0 0 0]\n",
      "epoch 1 sample 1 [0 1 -1 0 1 0 1]\n",
      "epoch 1 sample 2 [1 1 0 1 0 0 0]\n",
      "epoch 1 sample 3 [1 1 0 1 -1 -1 -1]\n",
      "epoch 2 sample 0 [0 0 -1 0 0 0 0]\n",
      "epoch 2 sample 1 [0 0 -1 0 1 0 1]\n",
      "epoch 2 sample 2 [1 0 0 0 0 1 1]\n",
      "epoch 2 sample 3 [1 1 1 1 -1 -1 -1]\n",
      "epoch 3 sample 0 [0 0 0 0 0 0 0]\n",
      "epoch 3 sample 1 [0 0 0 0 1 0 1]\n",
      "epoch 3 sample 2 [1 0 1 1 0 0 0]\n",
      "epoch 3 sample 3 [1 0 1 1 -1 -1 -1]\n",
      "epoch 4 sample 0 [0 -1 0 0 0 0 0]\n",
      "epoch 4 sample 1 [0 -1 0 0 1 0 1]\n",
      "epoch 4 sample 2 [1 -1 1 0 0 1 1]\n",
      "epoch 4 sample 3 [1 0 2 1 -1 -1 -1]\n",
      "epoch 5 sample 0 [0 -1 1 1 0 0 -1]\n",
      "epoch 5 sample 1 [0 -1 0 0 1 0 1]\n",
      "epoch 5 sample 2 [1 -1 1 0 0 1 1]\n",
      "epoch 5 sample 3 [1 0 2 1 -1 -1 -1]\n",
      "epoch 6 sample 0 [0 -1 1 1 0 0 -1]\n",
      "epoch 6 sample 1 [0 -1 0 0 1 0 1]\n",
      "epoch 6 sample 2 [1 -1 1 0 0 1 1]\n",
      "epoch 6 sample 3 [1 0 2 1 -1 -1 -1]\n",
      "epoch 7 sample 0 [0 -1 1 1 0 0 -1]\n",
      "epoch 7 sample 1 [0 -1 0 0 1 0 1]\n",
      "epoch 7 sample 2 [1 -1 1 0 0 1 1]\n",
      "epoch 7 sample 3 [1 0 2 1 -1 -1 -1]\n",
      "epoch 8 sample 0 [0 -1 1 1 0 0 -1]\n",
      "epoch 8 sample 1 [0 -1 0 0 1 0 1]\n",
      "epoch 8 sample 2 [1 -1 1 0 0 1 1]\n",
      "epoch 8 sample 3 [1 0 2 1 -1 -1 -1]\n",
      "epoch 9 sample 0 [0 -1 1 1 0 0 -1]\n",
      "epoch 9 sample 1 [0 -1 0 0 1 0 1]\n",
      "epoch 9 sample 2 [1 -1 1 0 0 1 1]\n",
      "epoch 9 sample 3 [1 0 2 1 -1 -1 -1]\n"
     ]
    }
   ],
   "source": [
    "#!/usr/bin/env python3 \n",
    "import numpy as np # 逻辑与数据\n",
    "samples_and = [ [0, 0, 0], [1, 0, 0], [0, 1, 0], [1, 1, 1], ]\n",
    "# 逻辑或数据\n",
    "samples_or = [ [0, 0, 0], [1, 0, 1], [0, 1, 1], [1, 1, 1], ]\n",
    "#逻辑异或数据 \n",
    "samples_xor = [ [0, 0, 0], [1, 0, 1], [0, 1, 1], [1, 1, 0], ]\n",
    "def perceptron(samples): \n",
    "    w = np.array([1, 2]) \n",
    "    b = 0 \n",
    "    a = 1 \n",
    "    \n",
    "    for i in range(10): \n",
    "        for j in range(4): \n",
    "            x = np.array(samples[j][:2]) \n",
    "            y = 1 if np.dot(w, x) + b > 0 else 0 \n",
    "            d = np.array(samples[j][2]) \n",
    "            delta_b = a*(d-y) \n",
    "            delta_w = a*(d-y)*x \n",
    "            print('epoch {} sample {} [{} {} {} {} {} {} {}]'.format( \n",
    "                i, j, w[0], w[1], b, y, delta_w[0], delta_w[1], delta_b \n",
    "            ))\n",
    "            w = w + delta_w \n",
    "            b = b + delta_b \n",
    "            \n",
    "            \n",
    "if __name__ == '__main__': \n",
    "    print('logical and') \n",
    "    perceptron(samples_and) \n",
    "    print('logical or') \n",
    "    perceptron(samples_or) \n",
    "    print('logical xor') \n",
    "    perceptron(samples_xor) "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 题目二"
   ]
  },
  {
   "attachments": {
    "image.png": {
     "image/png": "iVBORw0KGgoAAAANSUhEUgAAANcAAADACAYAAACXrvaWAAASvklEQVR4Ae2deWxU1R7HCxI1mPiHSwQXBIwrLrxnNGALguvLyxNMBBI1xD+EBPUBggiygyZuD+W5hAc+5SmbECkq+74VZAlFsCytSFlkK5SW0pa20On35Xem53oZptPb6b3jOTPfm9zcmXvP/M7vfH/n03Pumc7vpiHOraamBo3Z46yWH6MCf7oC0u+9bGmxComRkpISFBQU4OTJkxftcs7vXeooLCz03a7fftKe/7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WrFmjcmdIOqto9dR1XpeNdV2uNfa6rifaMZZtKR/k9VRqm26r5BKUX65XVlYqbfV5v4/S9yXrsyTI1dmnvQB9UWq1yA9IOimBSzLwrlq1CkuXLg1sl3yJmZmZ+PjjjyG54yUJaLT6JEFptPP6XKzrcq2x13U90Y6xbEv5IK+nUtt0WydOnIi5c+eqXJvR4uHXOen7c+bMwfDhw3HmjDxVxdsWEy4ZTcSw5HOXzh/0LinWJI/h+vXrVb3yOug6aT/4uPqtsfQLmeGIXX30u45Ie4sWLVJ1nT9//pKUFHWhFhMumc9KIk4ZdgU0OQa1i31JFSyPEvr1118hQ3HQdQbVFtoNrp+IttIvZJFt9erVKsem1lv6TBC7tq/zuuhjXVDp8zHh0oUScbxw4QJmz56tHgAhT1qR9MHcqEBdChw8eBCDBg1S0zV3Gen4QeyRdbjf1/XaGLhkMaN///7YvXs3ZC4tueq5UYG6FJBnF8gDEuUppO4tCLC8jlRuP+S1MXDl5+fjlVdeUf7JCCbPCONGBaIpoDv7/PnzMWnSpGhFjDhnDFyyCvPWW29BFjUkR7ysGHKjAtEUELjkq433339fPVOuId89RbMX1Dlj4JIGysqPPL5o2rRp/DI5qIgnid1jx47h3XffVY+9koeHmLgZA5f8NZJlzr179zboizoTRaVPwSogfUVmOvJsAblHl/8k0lPFYGtumHWj4GqY6yydqgpEAynauT9bH2Pg+rOFYP1UwG8F/g+BP10NDYLnTwAAAABJRU5ErkJggg=="
    }
   },
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "解释：因为单层感知器只能用于线性可分的问题，对于非线性的问题（如下图）单层感知器无法找到一条直线将目标点正确的分开\n",
    "![image.png](attachment:image.png)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
